using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AssetPool : PoolBase
{
    public override UnityEngine.Object Spwan(string name)
    {
        return base.Spwan(name);
    }

    public override void UnSpwan(string name, UnityEngine.Object obj)
    {
        base.UnSpwan(name, obj);
    }

    public override void Release()
    {
        base.Release();
        foreach(PoolObject poolObject in m_Pool)
        {
            if(System.DateTime.Now.Ticks - poolObject.LastUseTime.Ticks >= m_ReleaseTime * 10000000)
            {
                Debug.Log("AssetPool施放时间：" + System.DateTime.Now + "卸载ab包：" + poolObject.Name);
                //先卸载ab包
                Manager.Resource.UnloadBundle(poolObject.Object);
                m_Pool.Remove(poolObject);
                Release();
                return;
            }
        } 
    }
}
